<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<HTML>
<HEAD>
<TITLE>VT100.net: Digital VT102 User Guide</TITLE>
<LINK HREF="vt102-ug.css" TYPE="text/css" REL="stylesheet">
</HEAD>
<BODY>
<DIV CLASS="navbar"><A HREF="http://vt100.net/"><IMG CLASS="button" SRC="vt100.net-logo.png" ALT="VT100.net" HEIGHT="16" WIDTH="102"></A> VT102 User Guide<TABLE WIDTH="100%">
<COL SPAN="3" WIDTH="33%">
<TBODY>
<TR>
<TD ALIGN="LEFT"><A HREF="appendixb.html">Appendix B</A></TD>
<TD ALIGN="CENTER"><A HREF="contents.html">Contents</A></TD>
<TD ALIGN="RIGHT"><A HREF="appendixd.html">Appendix D</A></TD>
</TR>
</TBODY>
</TABLE>
<HR></DIV>
<H1 ID="SC"><SPAN CLASS="chapnum">C</SPAN> Programming Summary</H1>
<H2 ID="SC.1" CLASS="notoc">General</H2>
<P>This appendix provides a summary of VT102 escape and control sequences.</P>
<P><A HREF="figurec-1.html">Figure C-1</A> shows the codes generated by the standard keys. <A HREF="figurec-2.html">Figure C-2</A>
shows the control codes generated by the function keys; shaded keys do
not need <SPAN CLASS="keyname">CTRL</SPAN> down to generate the control character.</P>
<H2 ID="SC.2" CLASS="notoc">Programming Sequences</H2>
<P>The rest of this appendix repeats the information on the <CITE>VT102 Programming
Reference Card</CITE> (EK-VT102-RC-001).</P>
<H3 ID="SC.2.1" CLASS="notoc">Control Characters Received</H3>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH>Name</TH>
<TH>Character Mnemonic</TH>
<TH>Octal Code</TH>
<TH>Function</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Null</TD>
<TD>NUL</TD>
<TD>000</TD>
<TD>Ignored when received (not stored in input buffer) and used as a fill character.</TD>
</TR>
<TR VALIGN="TOP">
<TD>End of text</TD>
<TD>ETX</TD>
<TD>003</TD>
<TD>Can be selected as a half-duplex turnaround character.</TD>
</TR>
<TR VALIGN="TOP">
<TD>End of transmission</TD>
<TD>EOT</TD>
<TD>004</TD>
<TD>Can be selected as a disconnect character or half-duplex turnaround character. When used as a turnaround
character, the disconnect character is DLE-EOT.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Enquire</TD>
<TD>ENQ</TD>
<TD>005</TD>
<TD>Transmits answerback message.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Bell</TD>
<TD>BEL</TD>
<TD>007</TD>
<TD>Generates bell tone.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Backspace</TD>
<TD>BS</TD>
<TD>010</TD>
<TD>Moves cursor to the left one character position; if cursor is at left margin,
no action occurs.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Horizontal tab</TD>
<TD>HT</TD>
<TD>011</TD>
<TD>Moves cursor to next tab stop, or to right margin if there are no more tab stops.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Linefeed</TD>
<TD>LF</TD>
<TD>012</TD>
<TD>Causes a linefeed or a new line operation. (See Linefeed/New Line mode). Also causes
printing if auto print operation selected.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Vertical tab</TD>
<TD>VT</TD>
<TD>013</TD>
<TD>Processed as LF.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Form feed</TD>
<TD>FF</TD>
<TD>014</TD>
<TD>Processed as LF. FF can also be selected as a half-duplex turnaround character.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Carriage return</TD>
<TD>CR</TD>
<TD>015</TD>
<TD>Moves cursor to left margin on current line. CR can also be selected as a half-duplex
turnaround character.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Shift out</TD>
<TD>SO</TD>
<TD>016</TD>
<TD>Selects G1 character set designated by a select character set sequence.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Shift in</TD>
<TD>SI</TD>
<TD>017</TD>
<TD>Selects G0 character set designated by a select character set sequence.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Device control&nbsp;1</TD>
<TD>DC1</TD>
<TD>021</TD>
<TD>Processed as XON. DC1 causes terminal to continue transmitting characters.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Device control&nbsp;3</TD>
<TD>DC3</TD>
<TD>023</TD>
<TD>Processed as XOFF. DC3 causes terminal to stop transmitting all characters except
XOFF and XON. DC3 can also be selected as a half-duplex turnaround character.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Cancel</TD>
<TD>CAN</TD>
<TD>030</TD>
<TD>If received during an escape or control sequence, cancels the sequence and displays
substitution character (<IMG SRC="char141.png" ALT="[]" HEIGHT="20" WIDTH="12">).</TD>
</TR>
<TR VALIGN="TOP">
<TD>Substitute</TD>
<TD>SUB</TD>
<TD>032</TD>
<TD>Processed as CAN.</TD>
</TR>
<TR VALIGN="TOP">
<TD>Escape</TD>
<TD>ESC</TD>
<TD>033</TD>
<TD>Processed as a sequence introducer.</TD>
</TR>
</TBODY>
</TABLE>
<H3 ID="SC.2.2" CLASS="notoc">ANSI Compatible Sequences</H3>
<H4 ID="SC.2.2.1" CLASS="notoc">Set Mode</H4>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH>Name</TH>
<TH>Mnemonic</TH>
<TH>Mode</TH>
<TH>Sequence</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Keyboard action</TD>
<TD>KAM</TD>
<TD>Locked</TD>
<TD><CODE>ESC [ 2 h</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Insertion-replacement</TD>
<TD>IRM</TD>
<TD>Insert</TD>
<TD><CODE>ESC [ 4 h</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Send-receive</TD>
<TD>SRM</TD>
<TD>Off</TD>
<TD><CODE>ESC [ 1 2 h</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Linefeed/new line</TD>
<TD>LMN</TD>
<TD>New line</TD>
<TD><CODE>ESC [ 2 0 h</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Cursor key</TD>
<TD>DECCKM</TD>
<TD>Application</TD>
<TD><CODE>ESC [ ? 1 h</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>ANSI/VT52</TD>
<TD>DECANM</TD>
<TD>ANSI</TD>
<TD>N/A</TD>
</TR>
<TR VALIGN="TOP">
<TD>Column</TD>
<TD>DECCOLM</TD>
<TD>132 column</TD>
<TD><CODE>ESC [ ? 3 h</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Scrolling</TD>
<TD>DECSCLM</TD>
<TD>Smooth</TD>
<TD><CODE>ESC [ ? 4 h</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Screen</TD>
<TD>DECSCNM</TD>
<TD>Reverse</TD>
<TD><CODE>ESC [ ? 5 h</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Origin</TD>
<TD>DECOM</TD>
<TD>Relative</TD>
<TD><CODE>ESC [ ? 6 h</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Auto wrap</TD>
<TD>DECAWM</TD>
<TD>On</TD>
<TD><CODE>ESC [ ? 7 h</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Auto repeat</TD>
<TD>DECARM</TD>
<TD>On</TD>
<TD><CODE>ESC [ ? 8 h</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Print form feed</TD>
<TD>DECPFF</TD>
<TD>On</TD>
<TD><CODE>ESC [ ? 1 8 h</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Print extent</TD>
<TD>DECPEX</TD>
<TD>Full screen</TD>
<TD><CODE>ESC [ ? 1 9 h</CODE></TD>
</TR>
</TBODY>
</TABLE>
<H4 ID="SC.2.2.2" CLASS="notoc">Reset Mode</H4>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH>Name</TH>
<TH>Mnemonic</TH>
<TH>Mode</TH>
<TH>Sequence*</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Keyboard action</TD>
<TD>KAM</TD>
<TD>Unlocked</TD>
<TD><CODE>ESC [ 2 l</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Insertion-replacement</TD>
<TD>IRM</TD>
<TD>Replace</TD>
<TD><CODE>ESC [ 4 l</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Send-receive</TD>
<TD>SRM</TD>
<TD>On</TD>
<TD><CODE>ESC [ 1 2 l</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Linefeed/new line</TD>
<TD>LMN</TD>
<TD>Linefeed</TD>
<TD><CODE>ESC [ 2 0 l</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Cursor key</TD>
<TD>DECCKM</TD>
<TD>Cursor</TD>
<TD><CODE>ESC [ ? 1 l</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>ANSI/VT52</TD>
<TD>DECANM</TD>
<TD>VT52</TD>
<TD><CODE>ESC [ ? 2 l</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Column</TD>
<TD>DECCOLM</TD>
<TD>80 column</TD>
<TD><CODE>ESC [ ? 3 l</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Scrolling</TD>
<TD>DECSCLM</TD>
<TD>Jump</TD>
<TD><CODE>ESC [ ? 4 l</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Screen</TD>
<TD>DECSCNM</TD>
<TD>Normal</TD>
<TD><CODE>ESC [ ? 5 l</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Origin</TD>
<TD>DECOM</TD>
<TD>Absolute</TD>
<TD><CODE>ESC [ ? 6 l</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Auto wrap</TD>
<TD>DECAWM</TD>
<TD>Off</TD>
<TD><CODE>ESC [ ? 7 l</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Auto repeat</TD>
<TD>DECARM</TD>
<TD>Off</TD>
<TD><CODE>ESC [ ? 8 l</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Print form feed</TD>
<TD>DECPFF</TD>
<TD>Off</TD>
<TD><CODE>ESC [ ? 1 8 l</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Print extent</TD>
<TD>DECPEX</TD>
<TD>Scrolling region</TD>
<TD><CODE>ESC [ ? 1 9 l</CODE></TD>
</TR>
</TBODY>
<TBODY>
<TR VALIGN="TOP">
<TD COLSPAN="4"><SMALL>* The last character of the sequence is lowercase L (154<SUB>8</SUB>)</SMALL></TD>
</TR>
</TBODY>
</TABLE>
<H4 ID="SC.2.2.3" CLASS="notoc">Cursor Key Codes Generated</H4>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH ROWSPAN="2">Cursor Key (Arrow)</TH>
<TH COLSPAN="2">ANSI Characters Generated</TH>
</TR>
<TR VALIGN="BOTTOM">
<TH>Reset (Cursor)</TH>
<TH>Set (Application)</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Up</TD>
<TD><CODE>ESC [ A</CODE></TD>
<TD><CODE>ESC O A</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Down</TD>
<TD><CODE>ESC [ B</CODE></TD>
<TD><CODE>ESC O B</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Right</TD>
<TD><CODE>ESC [ C</CODE></TD>
<TD><CODE>ESC O C</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Left</TD>
<TD><CODE>ESC [ D</CODE></TD>
<TD><CODE>ESC O D</CODE></TD>
</TR>
</TBODY>
</TABLE>
<H4 ID="SC.2.2.4" CLASS="notoc">Keypad Character Selection</H4>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH>Name</TH>
<TH>Mnemonic</TH>
<TH>Sequence</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Alternate</TD>
<TD>DECKPAM</TD>
<TD><CODE>ESC =</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Numeric</TD>
<TD>DECKPNM</TD>
<TD><CODE>ESC &gt;</CODE></TD>
</TR>
</TBODY>
</TABLE>
<H4 ID="SC.2.2.5" CLASS="notoc">Keypad Codes Generated</H4>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH>Key</TH>
<TH>VT52 Numeric Keypad Mode</TH>
<TH>VT52 Alternate Keypad Mode</TH>
<TH>ANSI Numeric Keypad Mode</TH>
<TH>ANSI Alternate Keypad Mode</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>0</TD>
<TD>0</TD>
<TD><CODE>ESC ? p</CODE></TD>
<TD>0</TD>
<TD><CODE>ESC O p</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD></TD>
<TD></TD>
<TD></TD>
<TD></TD>
<TD></TD>
</TR>
<TR VALIGN="TOP">
<TD>1</TD>
<TD>1</TD>
<TD><CODE>ESC ? q</CODE></TD>
<TD>1</TD>
<TD><CODE>ESC O q</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>2</TD>
<TD>2</TD>
<TD><CODE>ESC ? r</CODE></TD>
<TD>2</TD>
<TD><CODE>ESC O r</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>3</TD>
<TD>3</TD>
<TD><CODE>ESC ? s</CODE></TD>
<TD>3</TD>
<TD><CODE>ESC O s</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>4</TD>
<TD>4</TD>
<TD><CODE>ESC ? t</CODE></TD>
<TD>4</TD>
<TD><CODE>ESC O t</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>5</TD>
<TD>5</TD>
<TD><CODE>ESC ? u</CODE></TD>
<TD>5</TD>
<TD><CODE>ESC O u</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>6</TD>
<TD>6</TD>
<TD><CODE>ESC ? v</CODE></TD>
<TD>6</TD>
<TD><CODE>ESC O v</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>7</TD>
<TD>7</TD>
<TD><CODE>ESC ? w</CODE></TD>
<TD>7</TD>
<TD><CODE>ESC O w</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>8</TD>
<TD>8</TD>
<TD><CODE>ESC ? x</CODE></TD>
<TD>8</TD>
<TD><CODE>ESC O x</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>9</TD>
<TD>9</TD>
<TD><CODE>ESC ? y</CODE></TD>
<TD>9</TD>
<TD><CODE>ESC O y</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>- (minus)</TD>
<TD>- (minus)</TD>
<TD><CODE>ESC ? m</CODE></TD>
<TD>- (minus)</TD>
<TD><CODE>ESC O m</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>, (comma)</TD>
<TD>, (comma)</TD>
<TD><CODE>ESC ? l</CODE>*</TD>
<TD>, (comma)</TD>
<TD><CODE>ESC O l</CODE>*</TD>
</TR>
<TR VALIGN="TOP">
<TD>. (period)</TD>
<TD>. (period)</TD>
<TD><CODE>ESC ? n</CODE></TD>
<TD>. (period)</TD>
<TD><CODE>ESC O n</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>ENTER</TD>
<TD>Same as RETURN</TD>
<TD><CODE>ESC ? M</CODE></TD>
<TD>Same as RETURN</TD>
<TD><CODE>ESC O M</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>PF1</TD>
<TD><CODE>ESC P</CODE></TD>
<TD><CODE>ESC P</CODE></TD>
<TD><CODE>ESC O P</CODE></TD>
<TD><CODE>ESC O P</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>PF2</TD>
<TD><CODE>ESC Q</CODE></TD>
<TD><CODE>ESC Q</CODE></TD>
<TD><CODE>ESC O Q</CODE></TD>
<TD><CODE>ESC O Q</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>PF3</TD>
<TD><CODE>ESC R</CODE></TD>
<TD><CODE>ESC R</CODE></TD>
<TD><CODE>ESC O R</CODE></TD>
<TD><CODE>ESC O R</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>PF4</TD>
<TD><CODE>ESC S</CODE></TD>
<TD><CODE>ESC S</CODE></TD>
<TD><CODE>ESC O S</CODE></TD>
<TD><CODE>ESC O S</CODE></TD>
</TR>
</TBODY>
<TBODY>
<TR VALIGN="TOP">
<TD COLSPAN="5"><SMALL>* The last character of the sequence is lowercase L (154<SUB>8</SUB>)</SMALL></TD>
</TR>
</TBODY>
</TABLE>
<H4 ID="SC.2.2.6" CLASS="notoc">Select Character Sets SCS</H4>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH>Character Set</TH>
<TH>G0 Designator</TH>
<TH>G1 Designator</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>United Kingdom (UK)</TD>
<TD><CODE>ESC ( A</CODE></TD>
<TD><CODE>ESC ) A</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>United States (US)</TD>
<TD><CODE>ESC ( B</CODE></TD>
<TD><CODE>ESC ) B</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Special characters and line drawing set</TD>
<TD><CODE>ESC ( 0</CODE></TD>
<TD><CODE>ESC ) 0</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Alternate character ROM</TD>
<TD><CODE>ESC ( 1</CODE></TD>
<TD><CODE>ESC ) 1</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Alternate character ROM - special characters</TD>
<TD><CODE>ESC ( 2</CODE></TD>
<TD><CODE>ESC ) 2</CODE></TD>
</TR>
</TBODY>
</TABLE>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH>Name</TH>
<TH>Mnemonic</TH>
<TH>Sequence</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Single shift 2</TD>
<TD>SS2</TD>
<TD><CODE>ESC N</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Single shift 3</TD>
<TD>SS3</TD>
<TD><CODE>ESC O</CODE></TD>
</TR>
</TBODY>
</TABLE>
<H4 ID="SC.2.2.7" CLASS="notoc">Character Attributes</H4>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH>Name</TH>
<TH>Mnemonic</TH>
<TH>Sequence</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Select graphic rendition (no attributes)</TD>
<TD>SGR</TD>
<TD><CODE>ESC [ m</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Select graphic rendition (no attributes)</TD>
<TD>SGR</TD>
<TD><CODE>ESC [ 0 m</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Select graphic rendition (select attribute bold)</TD>
<TD>SGR</TD>
<TD><CODE>ESC [ 1 m</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Select graphic rendition (select attribute underline)</TD>
<TD>SGR</TD>
<TD><CODE>ESC [ 4 m</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Select graphic rendition (select attribute blink)</TD>
<TD>SGR</TD>
<TD><CODE>ESC [ 5 m</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Select graphic rendition (select attribute, reverse video)</TD>
<TD>SGR</TD>
<TD><CODE>ESC [ 7 m</CODE></TD>
</TR>
</TBODY>
</TABLE>
<H4 ID="SC.2.2.8" CLASS="notoc">Scrolling Region</H4>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH>Name</TH>
<TH>Mnemonic</TH>
<TH>Sequence</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Set top and bottom margins</TD>
<TD>DECSTBM</TD>
<TD><CODE>ESC [ Pt ; Pb r</CODE></TD>
</TR>
</TBODY>
</TABLE>
<H4 ID="SC.2.2.9" CLASS="notoc">Cursor Movement Commands</H4>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH>Name</TH>
<TH>Mnemonic</TH>
<TH>Sequence</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Cursor up</TD>
<TD>CUU</TD>
<TD><CODE>ESC [ Pn A</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Cursor down</TD>
<TD>CUD</TD>
<TD><CODE>ESC [ Pn B</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Cursor forward (right)</TD>
<TD>CUF</TD>
<TD><CODE>ESC [ Pn C</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Cursor backward (left)</TD>
<TD>CUB</TD>
<TD><CODE>ESC [ Pn D</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Cursor position</TD>
<TD>CUP</TD>
<TD><CODE>ESC [ Pl ; Pc H</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Cursor position (home)</TD>
<TD>CUP</TD>
<TD><CODE>ESC [ H</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Horizontal and vertical position</TD>
<TD>HVP</TD>
<TD><CODE>ESC [ Pl ; Pc f</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Horizontal and vertical position (home)</TD>
<TD>HVP</TD>
<TD><CODE>ESC [ f</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Index</TD>
<TD>IND</TD>
<TD><CODE>ESC D</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Reverse index</TD>
<TD>RI</TD>
<TD><CODE>ESC M</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Next line</TD>
<TD>NEL</TD>
<TD><CODE>ESC E</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Save cursor (and attributes)</TD>
<TD>DECSC</TD>
<TD><CODE>ESC 7</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Restore cursor (and attributes)</TD>
<TD>DECRC</TD>
<TD><CODE>ESC 8</CODE></TD>
</TR>
</TBODY>
</TABLE>
<H4 ID="SC.2.2.10" CLASS="notoc">Tab Stops</H4>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH>Name</TH>
<TH>Mnemonic</TH>
<TH>Sequence</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Horizontal tab set (at current column)</TD>
<TD>HTS</TD>
<TD><CODE>ESC H</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Tabulation clear (at current column)</TD>
<TD>TBC</TD>
<TD><CODE>ESC [ g</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Tabulation clear (at current column)</TD>
<TD>TBC</TD>
<TD><CODE>ESC [ 0 g</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Tabulation clear (all tabs)</TD>
<TD>TBC</TD>
<TD><CODE>ESC [ 3 g</CODE></TD>
</TR>
</TBODY>
</TABLE>
<H4 ID="SC.2.2.11" CLASS="notoc">Line Attributes</H4>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH>Name</TH>
<TH>Mnemonic</TH>
<TH>Sequence</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Double-height top half</TD>
<TD>DECDHL</TD>
<TD><CODE>ESC # 3</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Double-height bottom half</TD>
<TD>DECDHL</TD>
<TD><CODE>ESC # 4</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Single-width single-height</TD>
<TD>DECSWL</TD>
<TD><CODE>ESC # 5</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Double-width single-height</TD>
<TD>DECDWL</TD>
<TD><CODE>ESC # 6</CODE></TD>
</TR>
</TBODY>
</TABLE>
<H4 ID="SC.2.2.12" CLASS="notoc">Erasing</H4>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH>Name</TH>
<TH>Mnemonic</TH>
<TH>Sequence</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Erase in line (cursor to end of line)</TD>
<TD>EL</TD>
<TD><CODE>ESC [ K</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Erase in line (cursor to end of line)</TD>
<TD>EL</TD>
<TD><CODE>ESC [ 0 K</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Erase in line (beginning of line to cursor)</TD>
<TD>EL</TD>
<TD><CODE>ESC [ 1 K</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Erase in line (entire line containing cursor)</TD>
<TD>EL</TD>
<TD><CODE>ESC [ 2 K</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Erase in display (cursor to end of screen)</TD>
<TD>ED</TD>
<TD><CODE>ESC [ J</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Erase in display (cursor to end of screen)</TD>
<TD>ED</TD>
<TD><CODE>ESC [ 0 J</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Erase in display (beginning of screen to cursor)</TD>
<TD>ED</TD>
<TD><CODE>ESC [ 1 J</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Erase in display (entire screen)</TD>
<TD>ED</TD>
<TD><CODE>ESC [ 2 J</CODE></TD>
</TR>
</TBODY>
</TABLE>
<H4 ID="SC.2.2.13" CLASS="notoc">Editing Functions</H4>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH>Name</TH>
<TH>Mnemonic</TH>
<TH>Sequence</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Delete character</TD>
<TD>DCH</TD>
<TD><CODE>ESC [ Pn P</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Insert line</TD>
<TD>IL</TD>
<TD><CODE>ESC [ Pn L</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Delete line</TD>
<TD>DL</TD>
<TD><CODE>ESC [ Pn M</CODE></TD>
</TR>
</TBODY>
</TABLE>
<H4 ID="SC.2.2.14" CLASS="notoc">Print Commands</H4>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH>Name</TH>
<TH>Mnemonic</TH>
<TH>Sequence</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Media copy (enter auto print)</TD>
<TD>MC</TD>
<TD><CODE>ESC [ ? 5 i</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Media copy (exit auto print)</TD>
<TD>MC</TD>
<TD><CODE>ESC [ ? 4 i</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Media copy (enter printer controller)</TD>
<TD>MC</TD>
<TD><CODE>ESC [ 5 i</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Media copy (exit printer controller)</TD>
<TD>MC</TD>
<TD><CODE>ESC [ 4 i</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Media copy (print screen)</TD>
<TD>MC</TD>
<TD><CODE>ESC [ i</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Media copy (print screen)</TD>
<TD>MC</TD>
<TD><CODE>ESC [ 0 i</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Media copy (print cursor line)</TD>
<TD>MC</TD>
<TD><CODE>ESC [ ? 1 i</CODE></TD>
</TR>
</TBODY>
</TABLE>
<H4 ID="SC.2.2.15" CLASS="notoc">Reports</H4>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH>Name</TH>
<TH>Mnemonic</TH>
<TH>Sequence</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Device status report (request status of VT102)</TD>
<TD>DSR</TD>
<TD><CODE>ESC [ 5 n</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Response:</TD>
<TD></TD>
<TD></TD>
</TR>
<TR VALIGN="TOP">
<TD>&nbsp;&nbsp;&nbsp;&nbsp;Terminal OK</TD>
<TD>DSR</TD>
<TD><CODE>ESC [ 0 n</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>&nbsp;&nbsp;&nbsp;&nbsp;Terminal not OK</TD>
<TD>DSR</TD>
<TD><CODE>ESC [ 3 n</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Device status report (request status of printer)</TD>
<TD>DSR</TD>
<TD><CODE>ESC [ ? 1 5 n</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Response:</TD>
<TD></TD>
<TD></TD>
</TR>
<TR VALIGN="TOP">
<TD>&nbsp;&nbsp;&nbsp;&nbsp;Printer ready</TD>
<TD>DSR</TD>
<TD><CODE>ESC [ ? 1 0 n</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>&nbsp;&nbsp;&nbsp;&nbsp;Printer not ready</TD>
<TD>DSR</TD>
<TD><CODE>ESC [ ? 1 1 n</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>&nbsp;&nbsp;&nbsp;&nbsp;No printer</TD>
<TD>DSR</TD>
<TD><CODE>ESC [ ? 1 3 n</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Device status report (report cursor position)</TD>
<TD>DSR</TD>
<TD><CODE>ESC [ 6 n</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Cursor position report</TD>
<TD>CPR</TD>
<TD><CODE>ESC [ Pl ; Pc R</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Device attributes (what are you)</TD>
<TD>DA</TD>
<TD><CODE>ESC [ c</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Device attributes (what are you)</TD>
<TD>DA</TD>
<TD><CODE>ESC [ 0 c</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Identify terminal (what are you)</TD>
<TD>DECID</TD>
<TD><CODE>ESC Z</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD COLSPAN="3"><P CLASS="note">NOTE: <CODE>ESC Z</CODE> is not recommended.</P></TD>
</TR>
<TR VALIGN="TOP">
<TD>Device attributes response: VT102</TD>
<TD>DA</TD>
<TD><CODE>ESC [ ? 6 c</CODE></TD>
</TR>
</TBODY>
</TABLE>
<H4 ID="SC.2.2.16" CLASS="notoc">Reset</H4>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH>Name</TH>
<TH>Mnemonic</TH>
<TH>Sequence</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Reset to initial state</TD>
<TD>RIS</TD>
<TD><CODE>ESC c</CODE></TD>
</TR>
</TBODY>
</TABLE>
<H4 ID="SC.2.2.17" CLASS="notoc">Tests and adjustments</H4>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH>Name</TH>
<TH>Mnemonic</TH>
<TH>Sequence</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Screen alignment display (fill screen with "Es")</TD>
<TD>DECALN</TD>
<TD><CODE>ESC # 8</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Invoke confidence test (power-up test)</TD>
<TD>DECTST</TD>
<TD><CODE>ESC [ 2 ; 1 y</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Invoke confidence test (data loopback test; requires test connector)</TD>
<TD>DECTST</TD>
<TD><CODE>ESC [ 2 ; 2 y</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Invoke confidence test (EIA modem control test; requires test connector)</TD>
<TD>DECTST</TD>
<TD><CODE>ESC [ 2 ; 4 y</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Invoke confidence test (repeat power-up test continuously until failure or power-off)</TD>
<TD>DECTST</TD>
<TD><CODE>ESC [ 2 ; 9 y</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Invoke confidence test (repeat data loopback test continuously until failure or power-off; requires test connector)</TD>
<TD>DECTST</TD>
<TD><CODE>ESC [ 2 ; 1 0 y</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Invoke confidence test (repeat EIA test continuously until failure or power-off; requires test connector)</TD>
<TD>DECTST</TD>
<TD><CODE>ESC [ 2 ; 1 2 y</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Invoke confidence test (printer port data loopback test; requires test connector)</TD>
<TD>DECTST</TD>
<TD><CODE>ESC [ 2 ; 1 6 y</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Invoke confidence test (repeat printer port data loopback test continuously until failure or power-off; requires test connector)</TD>
<TD>DECTST</TD>
<TD><CODE>ESC [ 2 ; 2 4 y</CODE></TD>
</TR>
</TBODY>
</TABLE>
<H4 ID="SC.2.2.18" CLASS="notoc">Keyboard LEDs</H4>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH>Name</TH>
<TH>Mnemonic</TH>
<TH>Sequence</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Load LEDs (L1 off)</TD>
<TD>DECLL</TD>
<TD><CODE>ESC [ q</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Load LEDs (L1 off)</TD>
<TD>DECLL</TD>
<TD><CODE>ESC [ 0 q</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Load LEDs (L1 on)</TD>
<TD>DECLL</TD>
<TD><CODE>ESC [ 1 q</CODE></TD>
</TR>
</TBODY>
</TABLE>
<H3 ID="SC.2.3" CLASS="notoc">VT52 Compatible Mode</H3>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH>Modes</TH>
<TH>Sequence</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Enter ANSI mode</TD>
<TD><CODE>ESC &lt;</CODE></TD>
</TR>
</TBODY>
</TABLE>
<H4 ID="SC.2.3.1" CLASS="notoc">Keypad Character Selection</H4>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH>Name</TH>
<TH>Sequence</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Enter alternate keypad mode</TD>
<TD><CODE>ESC =</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Exit alternate keypad mode (Numeric keypad mode)</TD>
<TD><CODE>ESC &gt;</CODE></TD>
</TR>
</TBODY>
</TABLE>
<P CLASS="note">NOTE: VT52 alternate keypad and numeric keypad mode different than ANSI.</P>
<H4 ID="SC.2.3.2" CLASS="notoc">Character Sets</H4>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH>Name</TH>
<TH>Sequence</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Special graphics character set</TD>
<TD><CODE>ESC F</CODE>*</TD>
</TR>
<TR VALIGN="TOP">
<TD>Select US/UK character set (as determined by the US/UK character SET-UP feature)</TD>
<TD><CODE>ESC G</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD COLSPAN="2"><SMALL>* Same as special character and line drawing set in ANSI mode.</SMALL></TD>
</TR>
</TBODY>
</TABLE>
<H4 ID="SC.2.3.3" CLASS="notoc">Cursor Position</H4>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH>Name</TH>
<TH>Sequence</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Cursor up*</TD>
<TD><CODE>ESC A</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Cursor down*</TD>
<TD><CODE>ESC B</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Cursor right*</TD>
<TD><CODE>ESC C</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Cursor left*</TD>
<TD><CODE>ESC D</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Cursor to home</TD>
<TD><CODE>ESC H</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Direct cursor address</TD>
<TD><CODE>ESC Y Pl Pc&#8224;</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Reverse line feed</TD>
<TD><CODE>ESC I&#8225;</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD COLSPAN="2"><SMALL>* Same when sent from the terminal.</SMALL></TD>
</TR>
<TR VALIGN="TOP">
<TD COLSPAN="2"><SMALL>&#8224; Line and column numbers for direct cursor address are single character codes whose values are the desired number plus 37<SUB>8</SUB>.<BR>
Line and colum numbers start at one.</SMALL></TD>
</TR>
<TR VALIGN="TOP">
<TD COLSPAN="2"><SMALL>&#8225; The last character of the sequence is an uppercase i (111<SUB>8</SUB>).</SMALL></TD>
</TR>
</TBODY>
</TABLE>
<H4 ID="SC.2.3.4" CLASS="notoc">Erasing</H4>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH>Name</TH>
<TH>Sequence</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Erase to end of line</TD>
<TD><CODE>ESC K</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Erase to end of screen</TD>
<TD><CODE>ESC J</CODE></TD>
</TR>
</TBODY>
</TABLE>
<H4 ID="SC.2.3.5" CLASS="notoc">Print Commands</H4>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH>Name</TH>
<TH>Sequence</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Enter auto print mode</TD>
<TD><CODE>ESC ^</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Exit auto print mode</TD>
<TD><CODE>ESC _</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Enter printer controller mode</TD>
<TD><CODE>ESC W</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Exit printer controll mode</TD>
<TD><CODE>ESC X</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Print screen</TD>
<TD><CODE>ESC ]</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Print cursor line</TD>
<TD><CODE>ESC V</CODE></TD>
</TR>
</TBODY>
</TABLE>
<H4 ID="SC.2.3.6" CLASS="notoc">Reports</H4>
<TABLE>
<THEAD>
<TR VALIGN="BOTTOM">
<TH>Name</TH>
<TH>Sequence</TH>
</TR>
</THEAD>
<TBODY>
<TR VALIGN="TOP">
<TD>Identify (what are you)</TD>
<TD><CODE>ESC Z</CODE></TD>
</TR>
<TR VALIGN="TOP">
<TD>Response: VT102 (same as VT52)</TD>
<TD><CODE>ESC / Z</CODE></TD>
</TR>
</TBODY>
</TABLE>
<DIV CLASS="navbar"><HR>
<TABLE WIDTH="100%">
<COL SPAN="3" WIDTH="33%">
<TBODY>
<TR>
<TD ALIGN="LEFT"><A HREF="appendixb.html">Appendix B</A></TD>
<TD ALIGN="CENTER"><A HREF="contents.html">Contents</A></TD>
<TD ALIGN="RIGHT"><A HREF="appendixd.html">Appendix D</A></TD>
</TR>
</TBODY>
</TABLE>
<DIV CLASS="navbot">http://vt100.net/docs/vt102-ug/appendixc.html</DIV></DIV>
</BODY>
</HTML>
